package com.sc.nft.controller;


import com.sc.nft.annotation.UserLogin;
import com.sc.nft.entity.dto.QueryBoxConditionDTO;
import com.sc.nft.entity.vo.QueryWebBoxConditionPackagingVO;
import com.sc.nft.pool.UserPool;
import com.sc.nft.service.BoxTakeConversionConditionService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 盲盒兑换条件(BoxTakeConversionCondition)表控制层
 *
 * @author 王伟成
 * @since 2023-11-07 17:21:41
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/boxTakeConversionCondition")
@Api(tags = "盲盒兑换条件")
public class BoxTakeConversionConditionController {
    /**
     * 服务对象
     */
    private final BoxTakeConversionConditionService boxTakeConversionConditionService;



    @PostMapping(value = "/queryConversionConditions", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查询兑换条件"  , notes = "查询兑换条件", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public Result<QueryWebBoxConditionPackagingVO> queryConversionConditions(@Valid @RequestBody QueryBoxConditionDTO queryBoxConditionDTO) {
        return Result.success(boxTakeConversionConditionService.queryConversionConditions(queryBoxConditionDTO, UserPool.getUser()));
    }


}
